<%@ Page Language="C#" MasterPageFile="~/master/AdminLayout.master" AutoEventWireup="true" CodeFile="membershiplist.aspx.cs" Inherits="page_private_admin_membershiplist" Title="Untitled Page" %>
<%@ Register Src="~/control/common/EmptyGridMessage.ascx" TagPrefix="ucc" TagName="EmptyGridMessage" %>
<%@ Register Assembly="Library" Namespace="Pheonix.CodeLibrary.Web" TagPrefix="ucc" %>

<asp:Content ID="workArea" ContentPlaceHolderID="WorkArea" Runat="Server">
    <table width="95%" style="margin-left:auto;margin-right:auto;" border="0">
        <tr>
            <td style="height:50px;" valign="middle" align="left">
                <h2>Available Memberships</h2>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                <asp:GridView ID="membershipList" runat="server" DataSourceID="membershipListData" AllowPaging="true" GridLines="None" BorderWidth="0px"
                    AllowSorting="true" AutoGenerateColumns="false" PageSize="10" DataKeyNames="Id" OnRowCommand="membershipList_RowCommand" 
                    OnRowDataBound="membershipList_RowDataBound" SkinID="AdminList" >
                    <Columns>
                        <asp:BoundField DataField="PackageName" HeaderText="Package" SortExpression="package_name" />
                        <asp:BoundField DataField="ExpireDate" HeaderText="Expire Date" SortExpression="expire_date" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="PackageCost" DataFormatString="{0} tk." HeaderText="Cost" ItemStyle-HorizontalAlign="Right" SortExpression="package_cost" />
                        <asp:TemplateField>
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                Edit
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="editButton" AlternateText="edit" ImageUrl="~/image/row_edit.gif"
                                    runat="server" CommandName="editCommand" />
                            </ItemTemplate>               
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                Delete
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="deleteButton" AlternateText="delete" ImageUrl="~/image/row_delete.gif"
                                    runat="server" CommandName="deleteCommand" />
                            </ItemTemplate>               
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <asp:CheckBox runat="server" ID="selectAll" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox runat="server" ID="rowSelect" />
                            </ItemTemplate>                
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <ucc:EmptyGridMessage ID="emptyGridMessage" runat="server" />
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
        <tr><td style="height:40px;">&nbsp;</td></tr>
        <tr>
            <td align="center" valign="bottom">
                <asp:ImageButton ID="addNewButton" runat="server" SkinID="ListAddNewButton"
                    OnClick="addNewButton_Click" /> 
                <asp:ImageButton ID="deleteAllButton" runat="server" SkinID="ListDeleteAllButton"
                    OnClick="deleteAllButton_Click" />
            </td>
        </tr>
    </table>

    <asp:ObjectDataSource ID="membershipListData" runat="server" EnablePaging="true" 
        TypeName="Pheonix.Fashionzoomer.Entity.SqlServer2000.Membership" SelectMethod="GetAllMembershipPaged"
        SelectCountMethod="GetAllMembershipPagedCount" DeleteMethod="DeleteMembership" SortParameterName="orderBy"
        StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows">
        <SelectParameters>
            <asp:Parameter Name="orderBy" Type="String" />
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:ControlParameter ControlID="membershipList" Name="id" />
        </DeleteParameters>   
    </asp:ObjectDataSource>
    
</asp:Content>

